import "vue-router";
import type { RouteComponent, RouteRecordRaw } from "vue-router";

export interface RouteMeta {
  title: string; // 路由标题
  icon?: string; // 图标类名
  icon_svg?: string; // 自定义图标
  is_hidden?: number; // 是否隐藏: 1:是 2:否
  is_keep_alive?: number; // 是否缓存: 1:是 2:否
  active_menu?: string; // 激活菜单的path
  is_large_screen?: number; // 是否仅在大屏显示: 1:是 2:否
  link?: string; // 外部链接地址
  type?: number; // 菜单类型: 1菜单,2接口,3按钮,4目录
}

export interface MenuItem {
  id?: number;
  pid?: number;
  path?: string;
  name?: string;
  sort?: number;
  component?: RouteComponent | string | undefined;
  meta: RouteMeta;
  children?: MenuItem[];
  status?: number; // 是否启用: 1-正常 2-禁用
  remark?: string;
}

export interface AppRouteRecordRaw extends Omit<RouteRecordRaw, "meta" | "children"> {
  meta?: RouteMeta;
  children?: AppRouteRecordRaw[];
}
